from dataclasses import dataclass

from src.application.order.dto.order import OrderDTO
from src.application.order.uow import OrderUoW


class GetExpiredOrdersHandler:
    """Получаем закончившиеся заказы"""

    def __init__(self, *, uow: OrderUoW) -> None:
        self._uow = uow

    async def __call__(self) -> list[OrderDTO]:
        orders = await self._uow.order_reader.get_expired_orders()

        return orders
